{% extends 'TopxiaWebBundle:My:layout.html.twig' %}

{% block title %}{{'所教%classroom.name%'|trans({'%classroom.name%':setting('classroom.name')|default('班级'|trans)})}} - {{ parent() }}{% endblock %}

{% set side_nav = 'my-teaching-classroom' %}

{% block main %}

<div class="panel panel-default panel-col lesson-manage-panel">
  <div class="panel-heading">
    {{'所教%classroom.name%'|trans({'%classroom.name%':setting('classroom.name')|default('班级'|trans)})}}
  </div>

  <div class="panel-body">
       <ul class="course-wide-list">
            {% if classrooms %}
            {% for classroom in classrooms %}
            <li class="course-item clearfix">
              <a class="course-picture-link" href="{{ path('classroom_show', {id:classroom.id}) }}" target="_blank">
                <img class="course-picture" src="{{ filepath(classroom.middlePicture, 'classroom.png') }}" alt="{{ classroom.title }}">
              </a>
              <div class="course-body">
                {% if members[classroom.id].role == "headTeacher"  or is_granted('ROLE_ADMIN') %}
                  <div style="float:right;" class="text-muted mrm mls">
                  <span class="glyphicon glyphicon-cog"></span> <a href="{{path('classroom_manage',{id:classroom.id})}}">{{'管理%classroom.name%'|trans({'%classroom.name%':setting('classroom.name')|default('班级'|trans)})}}</a>
                  </div>
                {% endif %}
                <h4 class="mbl"><a href="{{ path('classroom_show', {id:classroom.id}) }}" target="_blank">{{classroom.title}}</a>
                {% if classroom.status == "draft" %}
                <span class="label label-warning ">{{'未发布'|trans}}</span>
                {% elseif classroom.status == "closed" %}
                <span class="label label-danger ">{{'已关闭'|trans}}</span>
                {% endif %}
                </h4>

                <span class="text-muted">{{'共%coursesCount%课'|trans({'%coursesCount%':classroom.coursesCount})}}
                <i class="fa fa-users mll" ></i> {{classroom.studentNum + classroom.auditorNum}}</span>
                <div class="course-footer clearfix mtl">
                  <strong class="mrl">{{'今日新增'|trans}}</strong>

                   {{'学员%allCount%'|trans({'%allCount%':classroom.allCount})}}  &nbsp;&nbsp;

                   {{'话题%threadCount%'|trans({'%threadCount%':classroom.threadCount})}}  &nbsp;&nbsp; {{'课时完成学习%todayFinishedLessonNum%'|trans({'%todayFinishedLessonNum%':classroom.todayFinishedLessonNum})}}
                </div>
              </div>
            </li>
            {% endfor %}
            {% else %}
              <div class="empty">{{'找不到所教%classroom.name%！'|trans({'%classroom.name%':setting('classroom.name')|default('班级'|trans)})}}</div>
            {% endif %}
          </ul>
  </div>
</div>

{% endblock %}